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/heap.h"
27 #include "wine/debug.h"
29 #include "directmanipulation.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(manipulation
);
33 struct directmanipulation
35 IDirectManipulationManager2 IDirectManipulationManager2_iface
;
36 IDirectManipulationUpdateManager
*updatemanager
;
40 struct directupdatemanager
42 IDirectManipulationUpdateManager IDirectManipulationUpdateManager_iface
;
46 static inline struct directmanipulation
*impl_from_IDirectManipulationManager2(IDirectManipulationManager2
*iface
)
48 return CONTAINING_RECORD(iface
, struct directmanipulation
, IDirectManipulationManager2_iface
);
51 static inline struct directupdatemanager
*impl_from_IDirectManipulationUpdateManager(IDirectManipulationUpdateManager
*iface
)
53 return CONTAINING_RECORD(iface
, struct directupdatemanager
, IDirectManipulationUpdateManager_iface
);
56 static HRESULT WINAPI
update_manager_QueryInterface(IDirectManipulationUpdateManager
*iface
, REFIID riid
,void **ppv
)
58 struct directupdatemanager
*This
= impl_from_IDirectManipulationUpdateManager(iface
);
60 TRACE("(%p)->(%s,%p)\n", This
, debugstr_guid(riid
), ppv
);
62 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
63 IsEqualGUID(riid
, &IID_IDirectManipulationUpdateManager
)) {
64 IUnknown_AddRef(iface
);
69 FIXME("(%p)->(%s,%p), not found\n", This
, debugstr_guid(riid
), ppv
);
73 ULONG WINAPI
update_manager_AddRef(IDirectManipulationUpdateManager
*iface
)
75 struct directupdatemanager
*This
= impl_from_IDirectManipulationUpdateManager(iface
);
76 ULONG ref
= InterlockedIncrement(&This
->ref
);
78 TRACE("(%p) ref=%u\n", This
, ref
);
83 ULONG WINAPI
update_manager_Release(IDirectManipulationUpdateManager
*iface
)
85 struct directupdatemanager
*This
= impl_from_IDirectManipulationUpdateManager(iface
);
86 ULONG ref
= InterlockedDecrement(&This
->ref
);
88 TRACE("(%p) ref=%u\n", This
, ref
);
97 static HRESULT WINAPI
update_manager_RegisterWaitHandleCallback(IDirectManipulationUpdateManager
*iface
, HANDLE handle
,
98 IDirectManipulationUpdateHandler
*handler
, DWORD
*cookie
)
100 struct directupdatemanager
*This
= impl_from_IDirectManipulationUpdateManager(iface
);
101 FIXME("%p, %p, %p, %p\n", This
, handle
, handler
, cookie
);
105 static HRESULT WINAPI
update_manager_UnregisterWaitHandleCallback(IDirectManipulationUpdateManager
*iface
, DWORD cookie
)
107 struct directupdatemanager
*This
= impl_from_IDirectManipulationUpdateManager(iface
);
108 FIXME("%p, %x\n", This
, cookie
);
112 static HRESULT WINAPI
update_manager_Update(IDirectManipulationUpdateManager
*iface
, IDirectManipulationFrameInfoProvider
*provider
)
114 struct directupdatemanager
*This
= impl_from_IDirectManipulationUpdateManager(iface
);
115 FIXME("%p, %p\n", This
, provider
);
119 struct IDirectManipulationUpdateManagerVtbl updatemanagerVtbl
=
121 update_manager_QueryInterface
,
122 update_manager_AddRef
,
123 update_manager_Release
,
124 update_manager_RegisterWaitHandleCallback
,
125 update_manager_UnregisterWaitHandleCallback
,
126 update_manager_Update
129 static HRESULT
create_update_manager(IDirectManipulationUpdateManager
**obj
)
131 struct directupdatemanager
*object
;
133 object
= heap_alloc(sizeof(*object
));
135 return E_OUTOFMEMORY
;
137 object
->IDirectManipulationUpdateManager_iface
.lpVtbl
= &updatemanagerVtbl
;
140 *obj
= &object
->IDirectManipulationUpdateManager_iface
;
145 struct primarycontext
147 IDirectManipulationPrimaryContent IDirectManipulationPrimaryContent_iface
;
148 IDirectManipulationContent IDirectManipulationContent_iface
;
152 static inline struct primarycontext
*impl_from_IDirectManipulationPrimaryContent(IDirectManipulationPrimaryContent
*iface
)
154 return CONTAINING_RECORD(iface
, struct primarycontext
, IDirectManipulationPrimaryContent_iface
);
157 static inline struct primarycontext
*impl_from_IDirectManipulationContent(IDirectManipulationContent
*iface
)
159 return CONTAINING_RECORD(iface
, struct primarycontext
, IDirectManipulationContent_iface
);
162 static HRESULT WINAPI
primary_QueryInterface(IDirectManipulationPrimaryContent
*iface
, REFIID riid
, void **ppv
)
164 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
165 TRACE("(%p)->(%s,%p)\n", This
, debugstr_guid(riid
), ppv
);
167 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
168 IsEqualGUID(riid
, &IID_IDirectManipulationPrimaryContent
))
170 IDirectManipulationPrimaryContent_AddRef(&This
->IDirectManipulationPrimaryContent_iface
);
171 *ppv
= &This
->IDirectManipulationPrimaryContent_iface
;
174 else if(IsEqualGUID(riid
, &IID_IDirectManipulationContent
))
176 IUnknown_AddRef(iface
);
177 *ppv
= &This
->IDirectManipulationContent_iface
;
181 FIXME("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppv
);
182 return E_NOINTERFACE
;
185 static ULONG WINAPI
primary_AddRef(IDirectManipulationPrimaryContent
*iface
)
187 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
188 ULONG ref
= InterlockedIncrement(&This
->ref
);
190 TRACE("(%p) ref=%u\n", This
, ref
);
195 static ULONG WINAPI
primary_Release(IDirectManipulationPrimaryContent
*iface
)
197 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
198 ULONG ref
= InterlockedDecrement(&This
->ref
);
200 TRACE("(%p) ref=%u\n", This
, ref
);
209 static HRESULT WINAPI
primary_SetSnapInterval(IDirectManipulationPrimaryContent
*iface
, DIRECTMANIPULATION_MOTION_TYPES motion
,
210 float interval
, float offset
)
212 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
213 FIXME("%p, %d, %f, %f\n", This
, motion
, interval
, offset
);
217 static HRESULT WINAPI
primary_SetSnapPoints(IDirectManipulationPrimaryContent
*iface
, DIRECTMANIPULATION_MOTION_TYPES motion
,
218 const float *points
, DWORD count
)
220 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
221 FIXME("%p, %d, %p, %d\n", This
, motion
, points
, count
);
225 static HRESULT WINAPI
primary_SetSnapType(IDirectManipulationPrimaryContent
*iface
, DIRECTMANIPULATION_MOTION_TYPES motion
,
226 DIRECTMANIPULATION_SNAPPOINT_TYPE type
)
228 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
229 FIXME("%p, %d, %d\n", This
, motion
, type
);
233 static HRESULT WINAPI
primary_SetSnapCoordinate(IDirectManipulationPrimaryContent
*iface
, DIRECTMANIPULATION_MOTION_TYPES motion
,
234 DIRECTMANIPULATION_SNAPPOINT_COORDINATE coordinate
, float origin
)
236 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
237 FIXME("%p, %d, %d, %f\n", This
, motion
, coordinate
, origin
);
241 static HRESULT WINAPI
primary_SetZoomBoundaries(IDirectManipulationPrimaryContent
*iface
, float minimum
, float maximum
)
243 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
244 FIXME("%p, %f, %f\n", This
, minimum
, maximum
);
248 static HRESULT WINAPI
primary_SetHorizontalAlignment(IDirectManipulationPrimaryContent
*iface
, DIRECTMANIPULATION_HORIZONTALALIGNMENT alignment
)
250 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
251 FIXME("%p, %d\n", This
, alignment
);
255 static HRESULT WINAPI
primary_SetVerticalAlignment(IDirectManipulationPrimaryContent
*iface
, DIRECTMANIPULATION_VERTICALALIGNMENT alignment
)
257 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
258 FIXME("%p, %d\n", This
, alignment
);
262 static HRESULT WINAPI
primary_GetInertiaEndTransform(IDirectManipulationPrimaryContent
*iface
, float *matrix
, DWORD count
)
264 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
265 FIXME("%p, %p, %d\n", This
, matrix
, count
);
269 static HRESULT WINAPI
primary_GetCenterPoint(IDirectManipulationPrimaryContent
*iface
, float *x
, float *y
)
271 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
272 FIXME("%p, %p, %p\n", This
, x
, y
);
276 static const IDirectManipulationPrimaryContentVtbl primaryVtbl
=
278 primary_QueryInterface
,
281 primary_SetSnapInterval
,
282 primary_SetSnapPoints
,
284 primary_SetSnapCoordinate
,
285 primary_SetZoomBoundaries
,
286 primary_SetHorizontalAlignment
,
287 primary_SetVerticalAlignment
,
288 primary_GetInertiaEndTransform
,
289 primary_GetCenterPoint
293 static HRESULT WINAPI
content_QueryInterface(IDirectManipulationContent
*iface
, REFIID riid
, void **ppv
)
295 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
296 TRACE("(%p)->(%s,%p)\n", This
, debugstr_guid(riid
), ppv
);
298 return IDirectManipulationPrimaryContent_QueryInterface(&This
->IDirectManipulationPrimaryContent_iface
,
302 static ULONG WINAPI
content_AddRef(IDirectManipulationContent
*iface
)
304 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
305 return IDirectManipulationPrimaryContent_AddRef(&This
->IDirectManipulationPrimaryContent_iface
);
308 static ULONG WINAPI
content_Release(IDirectManipulationContent
*iface
)
310 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
311 return IDirectManipulationPrimaryContent_Release(&This
->IDirectManipulationPrimaryContent_iface
);
314 static HRESULT WINAPI
content_GetContentRect(IDirectManipulationContent
*iface
, RECT
*size
)
316 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
317 FIXME("%p, %p\n", This
, size
);
321 static HRESULT WINAPI
content_SetContentRect(IDirectManipulationContent
*iface
, const RECT
*size
)
323 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
324 FIXME("%p, %p\n", This
, size
);
328 static HRESULT WINAPI
content_GetViewport(IDirectManipulationContent
*iface
, REFIID riid
, void **object
)
330 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
331 FIXME("%p, %s, %p\n", This
, debugstr_guid(riid
), object
);
335 static HRESULT WINAPI
content_GetTag(IDirectManipulationContent
*iface
, REFIID riid
, void **object
, UINT32
*id
)
337 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
338 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(riid
), object
, id
);
342 static HRESULT WINAPI
content_SetTag(IDirectManipulationContent
*iface
, IUnknown
*object
, UINT32 id
)
344 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
345 FIXME("%p, %p, %d\n", This
, object
, id
);
349 static HRESULT WINAPI
content_GetOutputTransform(IDirectManipulationContent
*iface
,
350 float *matrix
, DWORD count
)
352 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
353 FIXME("%p, %p, %d\n", This
, matrix
, count
);
357 static HRESULT WINAPI
content_GetContentTransform(IDirectManipulationContent
*iface
,
358 float *matrix
, DWORD count
)
360 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
361 FIXME("%p, %p, %d\n", This
, matrix
, count
);
365 static HRESULT WINAPI
content_SyncContentTransform(IDirectManipulationContent
*iface
,
366 const float *matrix
, DWORD count
)
368 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
369 FIXME("%p, %p, %d\n", This
, matrix
, count
);
373 static const IDirectManipulationContentVtbl contentVtbl
=
375 content_QueryInterface
,
378 content_GetContentRect
,
379 content_SetContentRect
,
383 content_GetOutputTransform
,
384 content_GetContentTransform
,
385 content_SyncContentTransform
388 struct directviewport
390 IDirectManipulationViewport2 IDirectManipulationViewport2_iface
;
394 static inline struct directviewport
*impl_from_IDirectManipulationViewport2(IDirectManipulationViewport2
*iface
)
396 return CONTAINING_RECORD(iface
, struct directviewport
, IDirectManipulationViewport2_iface
);
399 static HRESULT WINAPI
viewport_QueryInterface(IDirectManipulationViewport2
*iface
, REFIID riid
, void **ppv
)
401 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
402 TRACE("(%p)->(%s,%p)\n", This
, debugstr_guid(riid
), ppv
);
404 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
405 IsEqualGUID(riid
, &IID_IDirectManipulationViewport
) ||
406 IsEqualGUID(riid
, &IID_IDirectManipulationViewport2
))
408 IDirectManipulationViewport2_AddRef(&This
->IDirectManipulationViewport2_iface
);
409 *ppv
= &This
->IDirectManipulationViewport2_iface
;
413 FIXME("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppv
);
414 return E_NOINTERFACE
;
417 static ULONG WINAPI
viewport_AddRef(IDirectManipulationViewport2
*iface
)
419 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
420 ULONG ref
= InterlockedIncrement(&This
->ref
);
422 TRACE("(%p) ref=%u\n", This
, ref
);
427 static ULONG WINAPI
viewport_Release(IDirectManipulationViewport2
*iface
)
429 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
430 ULONG ref
= InterlockedDecrement(&This
->ref
);
432 TRACE("(%p) ref=%u\n", This
, ref
);
441 static HRESULT WINAPI
viewport_Enable(IDirectManipulationViewport2
*iface
)
443 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
448 static HRESULT WINAPI
viewport_Disable(IDirectManipulationViewport2
*iface
)
450 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
455 static HRESULT WINAPI
viewport_SetContact(IDirectManipulationViewport2
*iface
, UINT32 id
)
457 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
458 FIXME("%p, %d\n", This
, id
);
462 static HRESULT WINAPI
viewport_ReleaseContact(IDirectManipulationViewport2
*iface
, UINT32 id
)
464 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
465 FIXME("%p, %d\n", This
, id
);
469 static HRESULT WINAPI
viewport_ReleaseAllContacts(IDirectManipulationViewport2
*iface
)
471 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
476 static HRESULT WINAPI
viewport_GetStatus(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_STATUS
*status
)
478 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
479 FIXME("%p, %p\n", This
, status
);
483 static HRESULT WINAPI
viewport_GetTag(IDirectManipulationViewport2
*iface
, REFIID riid
, void **object
, UINT32
*id
)
485 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
486 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(riid
), object
, id
);
490 static HRESULT WINAPI
viewport_SetTag(IDirectManipulationViewport2
*iface
, IUnknown
*object
, UINT32 id
)
492 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
493 FIXME("%p, %p, %u\n", This
, object
, id
);
497 static HRESULT WINAPI
viewport_GetViewportRect(IDirectManipulationViewport2
*iface
, RECT
*viewport
)
499 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
500 FIXME("%p, %p\n", This
, viewport
);
504 static HRESULT WINAPI
viewport_SetViewportRect(IDirectManipulationViewport2
*iface
, const RECT
*viewport
)
506 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
507 FIXME("%p, %p\n", This
, viewport
);
511 static HRESULT WINAPI
viewport_ZoomToRect(IDirectManipulationViewport2
*iface
, const float left
,
512 const float top
, const float right
, const float bottom
, BOOL animate
)
514 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
515 FIXME("%p, %f, %f, %f, %f, %d\n", This
, left
, top
, right
, bottom
, animate
);
519 static HRESULT WINAPI
viewport_SetViewportTransform(IDirectManipulationViewport2
*iface
,
520 const float *matrix
, DWORD count
)
522 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
523 FIXME("%p, %p, %d\n", This
, matrix
, count
);
527 static HRESULT WINAPI
viewport_SyncDisplayTransform(IDirectManipulationViewport2
*iface
,
528 const float *matrix
, DWORD count
)
530 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
531 FIXME("%p, %p, %d\n", This
, matrix
, count
);
535 static HRESULT WINAPI
viewport_GetPrimaryContent(IDirectManipulationViewport2
*iface
, REFIID riid
, void **object
)
537 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
538 TRACE("%p, %s, %p\n", This
, debugstr_guid(riid
), object
);
539 if(IsEqualGUID(riid
, &IID_IDirectManipulationPrimaryContent
))
541 struct primarycontext
*primary
;
542 TRACE("IDirectManipulationPrimaryContent\n");
543 primary
= heap_alloc( sizeof(*primary
));
545 return E_OUTOFMEMORY
;
547 primary
->IDirectManipulationPrimaryContent_iface
.lpVtbl
= &primaryVtbl
;
548 primary
->IDirectManipulationContent_iface
.lpVtbl
= &contentVtbl
;
551 *object
= &primary
->IDirectManipulationPrimaryContent_iface
;
556 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
560 static HRESULT WINAPI
viewport_AddContent(IDirectManipulationViewport2
*iface
, IDirectManipulationContent
*content
)
562 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
563 FIXME("%p, %p\n", This
, content
);
567 static HRESULT WINAPI
viewport_RemoveContent(IDirectManipulationViewport2
*iface
, IDirectManipulationContent
*content
)
569 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
570 FIXME("%p, %p\n", This
, content
);
574 static HRESULT WINAPI
viewport_SetViewportOptions(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_VIEWPORT_OPTIONS options
)
576 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
577 FIXME("%p, %d\n", This
, options
);
581 static HRESULT WINAPI
viewport_AddConfiguration(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_CONFIGURATION configuration
)
583 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
584 FIXME("%p, %d\n", This
, configuration
);
588 static HRESULT WINAPI
viewport_RemoveConfiguration(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_CONFIGURATION configuration
)
590 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
591 FIXME("%p, %d\n", This
, configuration
);
595 static HRESULT WINAPI
viewport_ActivateConfiguration(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_CONFIGURATION configuration
)
597 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
598 FIXME("%p, %d\n", This
, configuration
);
602 static HRESULT WINAPI
viewport_SetManualGesture(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_GESTURE_CONFIGURATION configuration
)
604 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
605 FIXME("%p, %d\n", This
, configuration
);
609 static HRESULT WINAPI
viewport_SetChaining(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_MOTION_TYPES enabledTypes
)
611 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
612 FIXME("%p, %d\n", This
, enabledTypes
);
616 static HRESULT WINAPI
viewport_AddEventHandler(IDirectManipulationViewport2
*iface
, HWND window
,
617 IDirectManipulationViewportEventHandler
*eventHandler
, DWORD
*cookie
)
619 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
620 FIXME("%p, %p, %p, %p\n", This
, window
, eventHandler
, cookie
);
624 static HRESULT WINAPI
viewport_RemoveEventHandler(IDirectManipulationViewport2
*iface
, DWORD cookie
)
626 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
627 FIXME("%p, %d\n", This
, cookie
);
631 static HRESULT WINAPI
viewport_SetInputMode(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_INPUT_MODE mode
)
633 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
634 FIXME("%p, %d\n", This
, mode
);
638 static HRESULT WINAPI
viewport_SetUpdateMode(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_INPUT_MODE mode
)
640 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
641 FIXME("%p, %d\n", This
, mode
);
645 static HRESULT WINAPI
viewport_Stop(IDirectManipulationViewport2
*iface
)
647 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
652 static HRESULT WINAPI
viewport_Abandon(IDirectManipulationViewport2
*iface
)
654 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
659 static HRESULT WINAPI
viewport_AddBehavior(IDirectManipulationViewport2
*iface
, IUnknown
*behavior
, DWORD
*cookie
)
661 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
662 FIXME("%p, %p, %p\n", This
, behavior
, cookie
);
666 static HRESULT WINAPI
viewport_RemoveBehavior(IDirectManipulationViewport2
*iface
, DWORD cookie
)
668 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
669 FIXME("%p, %d\n", This
, cookie
);
673 static HRESULT WINAPI
viewport_RemoveAllBehaviors(IDirectManipulationViewport2
*iface
)
675 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
680 static const IDirectManipulationViewport2Vtbl viewportVtbl
=
682 viewport_QueryInterface
,
688 viewport_ReleaseContact
,
689 viewport_ReleaseAllContacts
,
693 viewport_GetViewportRect
,
694 viewport_SetViewportRect
,
696 viewport_SetViewportTransform
,
697 viewport_SyncDisplayTransform
,
698 viewport_GetPrimaryContent
,
700 viewport_RemoveContent
,
701 viewport_SetViewportOptions
,
702 viewport_AddConfiguration
,
703 viewport_RemoveConfiguration
,
704 viewport_ActivateConfiguration
,
705 viewport_SetManualGesture
,
706 viewport_SetChaining
,
707 viewport_AddEventHandler
,
708 viewport_RemoveEventHandler
,
709 viewport_SetInputMode
,
710 viewport_SetUpdateMode
,
713 viewport_AddBehavior
,
714 viewport_RemoveBehavior
,
715 viewport_RemoveAllBehaviors
718 static HRESULT
create_viewport(IDirectManipulationViewport2
**obj
)
720 struct directviewport
*object
;
722 object
= heap_alloc(sizeof(*object
));
724 return E_OUTOFMEMORY
;
726 object
->IDirectManipulationViewport2_iface
.lpVtbl
= &viewportVtbl
;
729 *obj
= &object
->IDirectManipulationViewport2_iface
;
734 static HRESULT WINAPI
direct_manip_QueryInterface(IDirectManipulationManager2
*iface
, REFIID riid
, void **ppv
)
736 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
737 IsEqualGUID(riid
, &IID_IDirectManipulationManager
) ||
738 IsEqualGUID(riid
, &IID_IDirectManipulationManager2
)) {
739 IUnknown_AddRef(iface
);
744 FIXME("(%p)->(%s,%p),not found\n", iface
, debugstr_guid(riid
), ppv
);
745 return E_NOINTERFACE
;
748 static ULONG WINAPI
direct_manip_AddRef(IDirectManipulationManager2
*iface
)
750 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
751 ULONG ref
= InterlockedIncrement(&This
->ref
);
753 TRACE("(%p) ref=%u\n", This
, ref
);
758 static ULONG WINAPI
direct_manip_Release(IDirectManipulationManager2
*iface
)
760 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
761 ULONG ref
= InterlockedDecrement(&This
->ref
);
763 TRACE("(%p) ref=%u\n", This
, ref
);
767 if(This
->updatemanager
)
768 IDirectManipulationUpdateManager_Release(This
->updatemanager
);
774 static HRESULT WINAPI
direct_manip_Activate(IDirectManipulationManager2
*iface
, HWND window
)
776 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
777 FIXME("%p, %p\n", This
, window
);
781 static HRESULT WINAPI
direct_manip_Deactivate(IDirectManipulationManager2
*iface
, HWND window
)
783 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
784 FIXME("%p, %p\n", This
, window
);
788 static HRESULT WINAPI
direct_manip_RegisterHitTestTarget(IDirectManipulationManager2
*iface
, HWND window
,
789 HWND hittest
, DIRECTMANIPULATION_HITTEST_TYPE type
)
791 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
792 FIXME("%p, %p, %p, %d\n", This
, window
, hittest
, type
);
796 static HRESULT WINAPI
direct_manip_ProcessInput(IDirectManipulationManager2
*iface
, const MSG
*msg
, BOOL
*handled
)
798 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
799 FIXME("%p, %p, %p\n", This
, msg
, handled
);
803 static HRESULT WINAPI
direct_manip_GetUpdateManager(IDirectManipulationManager2
*iface
, REFIID riid
, void **obj
)
805 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
808 TRACE("%p, %s, %p\n", This
, debugstr_guid(riid
), obj
);
811 if(IsEqualGUID(riid
, &IID_IDirectManipulationUpdateManager
))
813 if(!This
->updatemanager
)
815 hr
= create_update_manager(&This
->updatemanager
);
824 IDirectManipulationUpdateManager_AddRef(This
->updatemanager
);
825 *obj
= This
->updatemanager
;
829 FIXME("Interface %s currently not supported.\n", debugstr_guid(riid
));
834 static HRESULT WINAPI
direct_manip_CreateViewport(IDirectManipulationManager2
*iface
, IDirectManipulationFrameInfoProvider
*frame
,
835 HWND window
, REFIID riid
, void **obj
)
837 HRESULT hr
= E_NOTIMPL
;
838 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
839 TRACE("%p, %p, %p, %s, %p\n", This
, frame
, window
, debugstr_guid(riid
), obj
);
841 if(IsEqualGUID(riid
, &IID_IDirectManipulationViewport
) ||
842 IsEqualGUID(riid
, &IID_IDirectManipulationViewport2
) )
844 hr
= create_viewport( (IDirectManipulationViewport2
**)obj
);
847 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
851 static HRESULT WINAPI
direct_manip_CreateContent(IDirectManipulationManager2
*iface
, IDirectManipulationFrameInfoProvider
*frame
,
852 REFCLSID clsid
, REFIID riid
, void **obj
)
854 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
855 FIXME("%p, %p, %s, %p\n", This
, frame
, debugstr_guid(riid
), obj
);
859 static HRESULT WINAPI
direct_manip_CreateBehavior(IDirectManipulationManager2
*iface
, REFCLSID clsid
, REFIID riid
, void **obj
)
861 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
862 FIXME("%p, %s, %s, %p\n", This
, debugstr_guid(clsid
), debugstr_guid(riid
), obj
);
866 static const struct IDirectManipulationManager2Vtbl directmanipVtbl
=
868 direct_manip_QueryInterface
,
870 direct_manip_Release
,
871 direct_manip_Activate
,
872 direct_manip_Deactivate
,
873 direct_manip_RegisterHitTestTarget
,
874 direct_manip_ProcessInput
,
875 direct_manip_GetUpdateManager
,
876 direct_manip_CreateViewport
,
877 direct_manip_CreateContent
,
878 direct_manip_CreateBehavior
881 static HRESULT WINAPI
DirectManipulation_CreateInstance(IClassFactory
*iface
, IUnknown
*outer
, REFIID riid
, void **ppv
)
883 struct directmanipulation
*object
;
886 TRACE("(%p, %s, %p)\n", outer
, debugstr_guid(riid
), ppv
);
890 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
892 return E_OUTOFMEMORY
;
894 object
->IDirectManipulationManager2_iface
.lpVtbl
= &directmanipVtbl
;
897 ret
= direct_manip_QueryInterface(&object
->IDirectManipulationManager2_iface
, riid
, ppv
);
898 direct_manip_Release(&object
->IDirectManipulationManager2_iface
);
903 struct directcompositor
905 IDirectManipulationCompositor2 IDirectManipulationCompositor2_iface
;
906 IDirectManipulationFrameInfoProvider IDirectManipulationFrameInfoProvider_iface
;
907 IDirectManipulationUpdateManager
*manager
;
911 static inline struct directcompositor
*impl_from_IDirectManipulationCompositor2(IDirectManipulationCompositor2
*iface
)
913 return CONTAINING_RECORD(iface
, struct directcompositor
, IDirectManipulationCompositor2_iface
);
916 static inline struct directcompositor
*impl_from_IDirectManipulationFrameInfoProvider(IDirectManipulationFrameInfoProvider
*iface
)
918 return CONTAINING_RECORD(iface
, struct directcompositor
, IDirectManipulationFrameInfoProvider_iface
);
921 static HRESULT WINAPI
compositor_QueryInterface(IDirectManipulationCompositor2
*iface
, REFIID riid
, void **ppv
)
923 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
925 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
926 IsEqualGUID(riid
, &IID_IDirectManipulationCompositor
) ||
927 IsEqualGUID(riid
, &IID_IDirectManipulationCompositor2
))
929 IUnknown_AddRef(iface
);
933 else if(IsEqualGUID(riid
, &IID_IDirectManipulationFrameInfoProvider
))
935 IUnknown_AddRef(iface
);
936 *ppv
= &This
->IDirectManipulationFrameInfoProvider_iface
;
940 FIXME("(%p)->(%s,%p),not found\n", iface
, debugstr_guid(riid
), ppv
);
941 return E_NOINTERFACE
;
944 static ULONG WINAPI
compositor_AddRef(IDirectManipulationCompositor2
*iface
)
946 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
947 ULONG ref
= InterlockedIncrement(&This
->ref
);
949 TRACE("(%p) ref=%u\n", This
, ref
);
954 static ULONG WINAPI
compositor_Release(IDirectManipulationCompositor2
*iface
)
956 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
957 ULONG ref
= InterlockedDecrement(&This
->ref
);
959 TRACE("(%p) ref=%u\n", This
, ref
);
964 IDirectManipulationUpdateManager_Release(This
->manager
);
970 static HRESULT WINAPI
compositor_AddContent(IDirectManipulationCompositor2
*iface
, IDirectManipulationContent
*content
,
971 IUnknown
*device
, IUnknown
*parent
, IUnknown
*child
)
973 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
974 FIXME("%p, %p, %p, %p, %p\n", This
, content
, device
, parent
, child
);
978 static HRESULT WINAPI
compositor_RemoveContent(IDirectManipulationCompositor2
*iface
, IDirectManipulationContent
*content
)
980 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
981 FIXME("%p, %p\n", This
, content
);
985 static HRESULT WINAPI
compositor_SetUpdateManager(IDirectManipulationCompositor2
*iface
, IDirectManipulationUpdateManager
*manager
)
987 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
988 TRACE("%p, %p\n", This
, manager
);
993 This
->manager
= manager
;
994 IDirectManipulationUpdateManager_AddRef(This
->manager
);
998 static HRESULT WINAPI
compositor_Flush(IDirectManipulationCompositor2
*iface
)
1000 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
1001 FIXME("%p\n", This
);
1005 static HRESULT WINAPI
compositor_AddContentWithCrossProcessChaining(IDirectManipulationCompositor2
*iface
,
1006 IDirectManipulationPrimaryContent
*content
, IUnknown
*device
, IUnknown
*parentvisual
, IUnknown
*childvisual
)
1008 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
1009 FIXME("%p %p %p %p %p\n", This
, content
, device
, parentvisual
, childvisual
);
1013 static const struct IDirectManipulationCompositor2Vtbl compositorVtbl
=
1015 compositor_QueryInterface
,
1018 compositor_AddContent
,
1019 compositor_RemoveContent
,
1020 compositor_SetUpdateManager
,
1022 compositor_AddContentWithCrossProcessChaining
1025 static HRESULT WINAPI
provider_QueryInterface(IDirectManipulationFrameInfoProvider
*iface
, REFIID riid
, void **ppv
)
1027 struct directcompositor
*This
= impl_from_IDirectManipulationFrameInfoProvider(iface
);
1028 return IDirectManipulationCompositor2_QueryInterface(&This
->IDirectManipulationCompositor2_iface
, riid
, ppv
);
1031 static ULONG WINAPI
provider_AddRef(IDirectManipulationFrameInfoProvider
*iface
)
1033 struct directcompositor
*This
= impl_from_IDirectManipulationFrameInfoProvider(iface
);
1034 return IDirectManipulationCompositor2_AddRef(&This
->IDirectManipulationCompositor2_iface
);
1037 static ULONG WINAPI
provider_Release(IDirectManipulationFrameInfoProvider
*iface
)
1039 struct directcompositor
*This
= impl_from_IDirectManipulationFrameInfoProvider(iface
);
1040 return IDirectManipulationCompositor2_Release(&This
->IDirectManipulationCompositor2_iface
);
1043 static HRESULT WINAPI
provider_GetNextFrameInfo(IDirectManipulationFrameInfoProvider
*iface
, ULONGLONG
*time
,
1044 ULONGLONG
*process
, ULONGLONG
*composition
)
1046 struct directcompositor
*This
= impl_from_IDirectManipulationFrameInfoProvider(iface
);
1047 FIXME("%p, %p, %p, %p\n", This
, time
, process
, composition
);
1051 static const struct IDirectManipulationFrameInfoProviderVtbl providerVtbl
=
1053 provider_QueryInterface
,
1056 provider_GetNextFrameInfo
1059 static HRESULT WINAPI
DirectCompositor_CreateInstance(IClassFactory
*iface
, IUnknown
*outer
, REFIID riid
, void **ppv
)
1061 struct directcompositor
*object
;
1064 TRACE("(%p, %s, %p)\n", outer
, debugstr_guid(riid
), ppv
);
1068 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
1070 return E_OUTOFMEMORY
;
1072 object
->IDirectManipulationCompositor2_iface
.lpVtbl
= &compositorVtbl
;
1073 object
->IDirectManipulationFrameInfoProvider_iface
.lpVtbl
= &providerVtbl
;
1076 ret
= compositor_QueryInterface(&object
->IDirectManipulationCompositor2_iface
, riid
, ppv
);
1077 compositor_Release(&object
->IDirectManipulationCompositor2_iface
);
1082 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
, REFIID riid
, void **ppv
)
1086 if(IsEqualGUID(&IID_IUnknown
, riid
) || IsEqualGUID(&IID_IClassFactory
, riid
)) {
1091 IUnknown_AddRef((IUnknown
*)*ppv
);
1095 WARN("(%p)->(%s %p)\n", iface
, debugstr_guid(riid
), ppv
);
1096 return E_NOINTERFACE
;
1099 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
1101 TRACE("(%p)\n", iface
);
1105 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
1107 TRACE("(%p)\n", iface
);
1111 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL fLock
)
1113 TRACE("(%p)->(%x)\n", iface
, fLock
);
1117 static const IClassFactoryVtbl DirectFactoryVtbl
= {
1118 ClassFactory_QueryInterface
,
1119 ClassFactory_AddRef
,
1120 ClassFactory_Release
,
1121 DirectManipulation_CreateInstance
,
1122 ClassFactory_LockServer
1125 static const IClassFactoryVtbl DirectCompositorVtbl
= {
1126 ClassFactory_QueryInterface
,
1127 ClassFactory_AddRef
,
1128 ClassFactory_Release
,
1129 DirectCompositor_CreateInstance
,
1130 ClassFactory_LockServer
1133 static IClassFactory direct_factory
= { &DirectFactoryVtbl
};
1134 static IClassFactory compositor_factory
= { &DirectCompositorVtbl
};
1136 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
1138 if(IsEqualGUID(&CLSID_DirectManipulationManager
, rclsid
) ||
1139 IsEqualGUID(&CLSID_DirectManipulationSharedManager
, rclsid
) ) {
1140 TRACE("(CLSID_DirectManipulationManager %s %p)\n", debugstr_guid(riid
), ppv
);
1141 return IClassFactory_QueryInterface(&direct_factory
, riid
, ppv
);
1143 else if(IsEqualGUID(&CLSID_DCompManipulationCompositor
, rclsid
)) {
1144 TRACE("(CLSID_DCompManipulationCompositor %s %p)\n", debugstr_guid(riid
), ppv
);
1145 return IClassFactory_QueryInterface(&compositor_factory
, riid
, ppv
);
1148 FIXME("%s %s %p\n", debugstr_guid(rclsid
), debugstr_guid(riid
), ppv
);
1149 return CLASS_E_CLASSNOTAVAILABLE
;