directmanipulation: Return S_OK form viewport_SetViewportOptions stub.
[wine/zf.git] / dlls / directmanipulation / directmanipulation.c
blob5bb3461d4431e4c8f6140e5c7712d3ed8036fb75
1 /*
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
18 #define COBJMACROS
20 #include <stdarg.h>
22 #include "windef.h"
23 #include "winbase.h"
24 #include "oleidl.h"
25 #include "rpcproxy.h"
26 #include "wine/heap.h"
27 #include "wine/debug.h"
29 #include "directmanipulation.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(manipulation);
33 static HINSTANCE dm_instance;
35 BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
37 TRACE("(%p, %u, %p)\n", instance, reason, reserved);
39 switch (reason)
41 case DLL_WINE_PREATTACH:
42 return FALSE; /* prefer native version */
43 case DLL_PROCESS_ATTACH:
44 dm_instance = instance;
45 DisableThreadLibraryCalls(instance);
46 break;
49 return TRUE;
52 HRESULT WINAPI DllRegisterServer(void)
54 return __wine_register_resources( dm_instance );
57 HRESULT WINAPI DllUnregisterServer(void)
59 return __wine_unregister_resources( dm_instance );
62 HRESULT WINAPI DllCanUnloadNow(void)
64 return S_FALSE;
68 struct directmanipulation
70 IDirectManipulationManager2 IDirectManipulationManager2_iface;
71 IDirectManipulationUpdateManager *updatemanager;
72 LONG ref;
75 struct directupdatemanager
77 IDirectManipulationUpdateManager IDirectManipulationUpdateManager_iface;
78 LONG ref;
81 static inline struct directmanipulation *impl_from_IDirectManipulationManager2(IDirectManipulationManager2 *iface)
83 return CONTAINING_RECORD(iface, struct directmanipulation, IDirectManipulationManager2_iface);
86 static inline struct directupdatemanager *impl_from_IDirectManipulationUpdateManager(IDirectManipulationUpdateManager *iface)
88 return CONTAINING_RECORD(iface, struct directupdatemanager, IDirectManipulationUpdateManager_iface);
91 static HRESULT WINAPI update_manager_QueryInterface(IDirectManipulationUpdateManager *iface, REFIID riid,void **ppv)
93 struct directupdatemanager *This = impl_from_IDirectManipulationUpdateManager(iface);
95 TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv);
97 if (IsEqualGUID(riid, &IID_IUnknown) ||
98 IsEqualGUID(riid, &IID_IDirectManipulationUpdateManager)) {
99 IUnknown_AddRef(iface);
100 *ppv = iface;
101 return S_OK;
104 FIXME("(%p)->(%s,%p), not found\n", This, debugstr_guid(riid), ppv);
105 return E_NOINTERFACE;
108 ULONG WINAPI update_manager_AddRef(IDirectManipulationUpdateManager *iface)
110 struct directupdatemanager *This = impl_from_IDirectManipulationUpdateManager(iface);
111 ULONG ref = InterlockedIncrement(&This->ref);
113 TRACE("(%p) ref=%u\n", This, ref);
115 return ref;
118 ULONG WINAPI update_manager_Release(IDirectManipulationUpdateManager *iface)
120 struct directupdatemanager *This = impl_from_IDirectManipulationUpdateManager(iface);
121 ULONG ref = InterlockedDecrement(&This->ref);
123 TRACE("(%p) ref=%u\n", This, ref);
125 if (!ref)
127 heap_free(This);
129 return ref;
132 static HRESULT WINAPI update_manager_RegisterWaitHandleCallback(IDirectManipulationUpdateManager *iface, HANDLE handle,
133 IDirectManipulationUpdateHandler *handler, DWORD *cookie)
135 struct directupdatemanager *This = impl_from_IDirectManipulationUpdateManager(iface);
136 FIXME("%p, %p, %p, %p\n", This, handle, handler, cookie);
137 return E_NOTIMPL;
140 static HRESULT WINAPI update_manager_UnregisterWaitHandleCallback(IDirectManipulationUpdateManager *iface, DWORD cookie)
142 struct directupdatemanager *This = impl_from_IDirectManipulationUpdateManager(iface);
143 FIXME("%p, %x\n", This, cookie);
144 return E_NOTIMPL;
147 static HRESULT WINAPI update_manager_Update(IDirectManipulationUpdateManager *iface, IDirectManipulationFrameInfoProvider *provider)
149 struct directupdatemanager *This = impl_from_IDirectManipulationUpdateManager(iface);
150 FIXME("%p, %p\n", This, provider);
151 return E_NOTIMPL;
154 struct IDirectManipulationUpdateManagerVtbl updatemanagerVtbl =
156 update_manager_QueryInterface,
157 update_manager_AddRef,
158 update_manager_Release,
159 update_manager_RegisterWaitHandleCallback,
160 update_manager_UnregisterWaitHandleCallback,
161 update_manager_Update
164 static HRESULT create_update_manager(IDirectManipulationUpdateManager **obj)
166 struct directupdatemanager *object;
168 object = heap_alloc(sizeof(*object));
169 if(!object)
170 return E_OUTOFMEMORY;
172 object->IDirectManipulationUpdateManager_iface.lpVtbl = &updatemanagerVtbl;
173 object->ref = 1;
175 *obj = &object->IDirectManipulationUpdateManager_iface;
177 return S_OK;
180 struct primarycontext
182 IDirectManipulationPrimaryContent IDirectManipulationPrimaryContent_iface;
183 IDirectManipulationContent IDirectManipulationContent_iface;
184 LONG ref;
187 static inline struct primarycontext *impl_from_IDirectManipulationPrimaryContent(IDirectManipulationPrimaryContent *iface)
189 return CONTAINING_RECORD(iface, struct primarycontext, IDirectManipulationPrimaryContent_iface);
192 static inline struct primarycontext *impl_from_IDirectManipulationContent(IDirectManipulationContent *iface)
194 return CONTAINING_RECORD(iface, struct primarycontext, IDirectManipulationContent_iface);
197 static HRESULT WINAPI primary_QueryInterface(IDirectManipulationPrimaryContent *iface, REFIID riid, void **ppv)
199 struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface);
200 TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv);
202 if (IsEqualGUID(riid, &IID_IUnknown) ||
203 IsEqualGUID(riid, &IID_IDirectManipulationPrimaryContent))
205 IDirectManipulationPrimaryContent_AddRef(&This->IDirectManipulationPrimaryContent_iface);
206 *ppv = &This->IDirectManipulationPrimaryContent_iface;
207 return S_OK;
209 else if(IsEqualGUID(riid, &IID_IDirectManipulationContent))
211 IUnknown_AddRef(iface);
212 *ppv = &This->IDirectManipulationContent_iface;
213 return S_OK;
216 FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv);
217 return E_NOINTERFACE;
220 static ULONG WINAPI primary_AddRef(IDirectManipulationPrimaryContent *iface)
222 struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface);
223 ULONG ref = InterlockedIncrement(&This->ref);
225 TRACE("(%p) ref=%u\n", This, ref);
227 return ref;
230 static ULONG WINAPI primary_Release(IDirectManipulationPrimaryContent *iface)
232 struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface);
233 ULONG ref = InterlockedDecrement(&This->ref);
235 TRACE("(%p) ref=%u\n", This, ref);
237 if (!ref)
239 heap_free(This);
241 return ref;
244 static HRESULT WINAPI primary_SetSnapInterval(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_MOTION_TYPES motion,
245 float interval, float offset)
247 struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface);
248 FIXME("%p, %d, %f, %f\n", This, motion, interval, offset);
249 return E_NOTIMPL;
252 static HRESULT WINAPI primary_SetSnapPoints(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_MOTION_TYPES motion,
253 const float *points, DWORD count)
255 struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface);
256 FIXME("%p, %d, %p, %d\n", This, motion, points, count);
257 return E_NOTIMPL;
260 static HRESULT WINAPI primary_SetSnapType(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_MOTION_TYPES motion,
261 DIRECTMANIPULATION_SNAPPOINT_TYPE type)
263 struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface);
264 FIXME("%p, %d, %d\n", This, motion, type);
265 return E_NOTIMPL;
268 static HRESULT WINAPI primary_SetSnapCoordinate(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_MOTION_TYPES motion,
269 DIRECTMANIPULATION_SNAPPOINT_COORDINATE coordinate, float origin)
271 struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface);
272 FIXME("%p, %d, %d, %f\n", This, motion, coordinate, origin);
273 return E_NOTIMPL;
276 static HRESULT WINAPI primary_SetZoomBoundaries(IDirectManipulationPrimaryContent *iface, float minimum, float maximum)
278 struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface);
279 FIXME("%p, %f, %f\n", This, minimum, maximum);
280 return E_NOTIMPL;
283 static HRESULT WINAPI primary_SetHorizontalAlignment(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_HORIZONTALALIGNMENT alignment)
285 struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface);
286 FIXME("%p, %d\n", This, alignment);
287 return E_NOTIMPL;
290 static HRESULT WINAPI primary_SetVerticalAlignment(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_VERTICALALIGNMENT alignment)
292 struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface);
293 FIXME("%p, %d\n", This, alignment);
294 return E_NOTIMPL;
297 static HRESULT WINAPI primary_GetInertiaEndTransform(IDirectManipulationPrimaryContent *iface, float *matrix, DWORD count)
299 struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface);
300 FIXME("%p, %p, %d\n", This, matrix, count);
301 return E_NOTIMPL;
304 static HRESULT WINAPI primary_GetCenterPoint(IDirectManipulationPrimaryContent *iface, float *x, float *y)
306 struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface);
307 FIXME("%p, %p, %p\n", This, x, y);
308 return E_NOTIMPL;
311 static const IDirectManipulationPrimaryContentVtbl primaryVtbl =
313 primary_QueryInterface,
314 primary_AddRef,
315 primary_Release,
316 primary_SetSnapInterval,
317 primary_SetSnapPoints,
318 primary_SetSnapType,
319 primary_SetSnapCoordinate,
320 primary_SetZoomBoundaries,
321 primary_SetHorizontalAlignment,
322 primary_SetVerticalAlignment,
323 primary_GetInertiaEndTransform,
324 primary_GetCenterPoint
328 static HRESULT WINAPI content_QueryInterface(IDirectManipulationContent *iface, REFIID riid, void **ppv)
330 struct primarycontext *This = impl_from_IDirectManipulationContent(iface);
331 TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv);
333 return IDirectManipulationPrimaryContent_QueryInterface(&This->IDirectManipulationPrimaryContent_iface,
334 riid, ppv);
337 static ULONG WINAPI content_AddRef(IDirectManipulationContent *iface)
339 struct primarycontext *This = impl_from_IDirectManipulationContent(iface);
340 return IDirectManipulationPrimaryContent_AddRef(&This->IDirectManipulationPrimaryContent_iface);
343 static ULONG WINAPI content_Release(IDirectManipulationContent *iface)
345 struct primarycontext *This = impl_from_IDirectManipulationContent(iface);
346 return IDirectManipulationPrimaryContent_Release(&This->IDirectManipulationPrimaryContent_iface);
349 static HRESULT WINAPI content_GetContentRect(IDirectManipulationContent *iface, RECT *size)
351 struct primarycontext *This = impl_from_IDirectManipulationContent(iface);
352 FIXME("%p, %p\n", This, size);
353 return E_NOTIMPL;
356 static HRESULT WINAPI content_SetContentRect(IDirectManipulationContent *iface, const RECT *size)
358 struct primarycontext *This = impl_from_IDirectManipulationContent(iface);
359 FIXME("%p, %p\n", This, size);
360 return S_OK;
363 static HRESULT WINAPI content_GetViewport(IDirectManipulationContent *iface, REFIID riid, void **object)
365 struct primarycontext *This = impl_from_IDirectManipulationContent(iface);
366 FIXME("%p, %s, %p\n", This, debugstr_guid(riid), object);
367 return E_NOTIMPL;
370 static HRESULT WINAPI content_GetTag(IDirectManipulationContent *iface, REFIID riid, void **object, UINT32 *id)
372 struct primarycontext *This = impl_from_IDirectManipulationContent(iface);
373 FIXME("%p, %s, %p, %p\n", This, debugstr_guid(riid), object, id);
374 return E_NOTIMPL;
377 static HRESULT WINAPI content_SetTag(IDirectManipulationContent *iface, IUnknown *object, UINT32 id)
379 struct primarycontext *This = impl_from_IDirectManipulationContent(iface);
380 FIXME("%p, %p, %d\n", This, object, id);
381 return E_NOTIMPL;
384 static HRESULT WINAPI content_GetOutputTransform(IDirectManipulationContent *iface,
385 float *matrix, DWORD count)
387 struct primarycontext *This = impl_from_IDirectManipulationContent(iface);
388 FIXME("%p, %p, %d\n", This, matrix, count);
389 return E_NOTIMPL;
392 static HRESULT WINAPI content_GetContentTransform(IDirectManipulationContent *iface,
393 float *matrix, DWORD count)
395 struct primarycontext *This = impl_from_IDirectManipulationContent(iface);
396 FIXME("%p, %p, %d\n", This, matrix, count);
397 return E_NOTIMPL;
400 static HRESULT WINAPI content_SyncContentTransform(IDirectManipulationContent *iface,
401 const float *matrix, DWORD count)
403 struct primarycontext *This = impl_from_IDirectManipulationContent(iface);
404 FIXME("%p, %p, %d\n", This, matrix, count);
405 return E_NOTIMPL;
408 static const IDirectManipulationContentVtbl contentVtbl =
410 content_QueryInterface,
411 content_AddRef,
412 content_Release,
413 content_GetContentRect,
414 content_SetContentRect,
415 content_GetViewport,
416 content_GetTag,
417 content_SetTag,
418 content_GetOutputTransform,
419 content_GetContentTransform,
420 content_SyncContentTransform
423 struct directviewport
425 IDirectManipulationViewport2 IDirectManipulationViewport2_iface;
426 LONG ref;
429 static inline struct directviewport *impl_from_IDirectManipulationViewport2(IDirectManipulationViewport2 *iface)
431 return CONTAINING_RECORD(iface, struct directviewport, IDirectManipulationViewport2_iface);
434 static HRESULT WINAPI viewport_QueryInterface(IDirectManipulationViewport2 *iface, REFIID riid, void **ppv)
436 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
437 TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv);
439 if (IsEqualGUID(riid, &IID_IUnknown) ||
440 IsEqualGUID(riid, &IID_IDirectManipulationViewport) ||
441 IsEqualGUID(riid, &IID_IDirectManipulationViewport2))
443 IDirectManipulationViewport2_AddRef(&This->IDirectManipulationViewport2_iface);
444 *ppv = &This->IDirectManipulationViewport2_iface;
445 return S_OK;
448 FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv);
449 return E_NOINTERFACE;
452 static ULONG WINAPI viewport_AddRef(IDirectManipulationViewport2 *iface)
454 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
455 ULONG ref = InterlockedIncrement(&This->ref);
457 TRACE("(%p) ref=%u\n", This, ref);
459 return ref;
462 static ULONG WINAPI viewport_Release(IDirectManipulationViewport2 *iface)
464 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
465 ULONG ref = InterlockedDecrement(&This->ref);
467 TRACE("(%p) ref=%u\n", This, ref);
469 if (!ref)
471 heap_free(This);
473 return ref;
476 static HRESULT WINAPI viewport_Enable(IDirectManipulationViewport2 *iface)
478 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
479 FIXME("%p\n", This);
480 return E_NOTIMPL;
483 static HRESULT WINAPI viewport_Disable(IDirectManipulationViewport2 *iface)
485 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
486 FIXME("%p\n", This);
487 return E_NOTIMPL;
490 static HRESULT WINAPI viewport_SetContact(IDirectManipulationViewport2 *iface, UINT32 id)
492 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
493 FIXME("%p, %d\n", This, id);
494 return E_NOTIMPL;
497 static HRESULT WINAPI viewport_ReleaseContact(IDirectManipulationViewport2 *iface, UINT32 id)
499 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
500 FIXME("%p, %d\n", This, id);
501 return E_NOTIMPL;
504 static HRESULT WINAPI viewport_ReleaseAllContacts(IDirectManipulationViewport2 *iface)
506 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
507 FIXME("%p\n", This);
508 return E_NOTIMPL;
511 static HRESULT WINAPI viewport_GetStatus(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_STATUS *status)
513 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
514 FIXME("%p, %p\n", This, status);
515 return E_NOTIMPL;
518 static HRESULT WINAPI viewport_GetTag(IDirectManipulationViewport2 *iface, REFIID riid, void **object, UINT32 *id)
520 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
521 FIXME("%p, %s, %p, %p\n", This, debugstr_guid(riid), object, id);
522 return E_NOTIMPL;
525 static HRESULT WINAPI viewport_SetTag(IDirectManipulationViewport2 *iface, IUnknown *object, UINT32 id)
527 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
528 FIXME("%p, %p, %u\n", This, object, id);
529 return E_NOTIMPL;
532 static HRESULT WINAPI viewport_GetViewportRect(IDirectManipulationViewport2 *iface, RECT *viewport)
534 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
535 FIXME("%p, %p\n", This, viewport);
536 return E_NOTIMPL;
539 static HRESULT WINAPI viewport_SetViewportRect(IDirectManipulationViewport2 *iface, const RECT *viewport)
541 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
542 FIXME("%p, %p\n", This, viewport);
543 return S_OK;
546 static HRESULT WINAPI viewport_ZoomToRect(IDirectManipulationViewport2 *iface, const float left,
547 const float top, const float right, const float bottom, BOOL animate)
549 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
550 FIXME("%p, %f, %f, %f, %f, %d\n", This, left, top, right, bottom, animate);
551 return E_NOTIMPL;
554 static HRESULT WINAPI viewport_SetViewportTransform(IDirectManipulationViewport2 *iface,
555 const float *matrix, DWORD count)
557 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
558 FIXME("%p, %p, %d\n", This, matrix, count);
559 return E_NOTIMPL;
562 static HRESULT WINAPI viewport_SyncDisplayTransform(IDirectManipulationViewport2 *iface,
563 const float *matrix, DWORD count)
565 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
566 FIXME("%p, %p, %d\n", This, matrix, count);
567 return E_NOTIMPL;
570 static HRESULT WINAPI viewport_GetPrimaryContent(IDirectManipulationViewport2 *iface, REFIID riid, void **object)
572 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
573 TRACE("%p, %s, %p\n", This, debugstr_guid(riid), object);
574 if(IsEqualGUID(riid, &IID_IDirectManipulationPrimaryContent))
576 struct primarycontext *primary;
577 TRACE("IDirectManipulationPrimaryContent\n");
578 primary = heap_alloc( sizeof(*primary));
579 if(!primary)
580 return E_OUTOFMEMORY;
582 primary->IDirectManipulationPrimaryContent_iface.lpVtbl = &primaryVtbl;
583 primary->IDirectManipulationContent_iface.lpVtbl = &contentVtbl;
584 primary->ref = 1;
586 *object = &primary->IDirectManipulationPrimaryContent_iface;
588 return S_OK;
590 else
591 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
592 return E_NOTIMPL;
595 static HRESULT WINAPI viewport_AddContent(IDirectManipulationViewport2 *iface, IDirectManipulationContent *content)
597 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
598 FIXME("%p, %p\n", This, content);
599 return E_NOTIMPL;
602 static HRESULT WINAPI viewport_RemoveContent(IDirectManipulationViewport2 *iface, IDirectManipulationContent *content)
604 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
605 FIXME("%p, %p\n", This, content);
606 return E_NOTIMPL;
609 static HRESULT WINAPI viewport_SetViewportOptions(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_VIEWPORT_OPTIONS options)
611 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
612 FIXME("%p, %d\n", This, options);
613 return S_OK;
616 static HRESULT WINAPI viewport_AddConfiguration(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_CONFIGURATION configuration)
618 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
619 FIXME("%p, %d\n", This, configuration);
620 return E_NOTIMPL;
623 static HRESULT WINAPI viewport_RemoveConfiguration(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_CONFIGURATION configuration)
625 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
626 FIXME("%p, %d\n", This, configuration);
627 return E_NOTIMPL;
630 static HRESULT WINAPI viewport_ActivateConfiguration(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_CONFIGURATION configuration)
632 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
633 FIXME("%p, %d\n", This, configuration);
634 return S_OK;
637 static HRESULT WINAPI viewport_SetManualGesture(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_GESTURE_CONFIGURATION configuration)
639 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
640 FIXME("%p, %d\n", This, configuration);
641 return E_NOTIMPL;
644 static HRESULT WINAPI viewport_SetChaining(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_MOTION_TYPES enabledTypes)
646 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
647 FIXME("%p, %d\n", This, enabledTypes);
648 return E_NOTIMPL;
651 static HRESULT WINAPI viewport_AddEventHandler(IDirectManipulationViewport2 *iface, HWND window,
652 IDirectManipulationViewportEventHandler *eventHandler, DWORD *cookie)
654 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
655 FIXME("%p, %p, %p, %p\n", This, window, eventHandler, cookie);
656 return E_NOTIMPL;
659 static HRESULT WINAPI viewport_RemoveEventHandler(IDirectManipulationViewport2 *iface, DWORD cookie)
661 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
662 FIXME("%p, %d\n", This, cookie);
663 return E_NOTIMPL;
666 static HRESULT WINAPI viewport_SetInputMode(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_INPUT_MODE mode)
668 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
669 FIXME("%p, %d\n", This, mode);
670 return E_NOTIMPL;
673 static HRESULT WINAPI viewport_SetUpdateMode(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_INPUT_MODE mode)
675 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
676 FIXME("%p, %d\n", This, mode);
677 return E_NOTIMPL;
680 static HRESULT WINAPI viewport_Stop(IDirectManipulationViewport2 *iface)
682 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
683 FIXME("%p\n", This);
684 return E_NOTIMPL;
687 static HRESULT WINAPI viewport_Abandon(IDirectManipulationViewport2 *iface)
689 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
690 FIXME("%p\n", This);
691 return E_NOTIMPL;
694 static HRESULT WINAPI viewport_AddBehavior(IDirectManipulationViewport2 *iface, IUnknown *behavior, DWORD *cookie)
696 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
697 FIXME("%p, %p, %p\n", This, behavior, cookie);
698 return E_NOTIMPL;
701 static HRESULT WINAPI viewport_RemoveBehavior(IDirectManipulationViewport2 *iface, DWORD cookie)
703 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
704 FIXME("%p, %d\n", This, cookie);
705 return E_NOTIMPL;
708 static HRESULT WINAPI viewport_RemoveAllBehaviors(IDirectManipulationViewport2 *iface)
710 struct directviewport *This = impl_from_IDirectManipulationViewport2(iface);
711 FIXME("%p\n", This);
712 return E_NOTIMPL;
715 static const IDirectManipulationViewport2Vtbl viewportVtbl =
717 viewport_QueryInterface,
718 viewport_AddRef,
719 viewport_Release,
720 viewport_Enable,
721 viewport_Disable,
722 viewport_SetContact,
723 viewport_ReleaseContact,
724 viewport_ReleaseAllContacts,
725 viewport_GetStatus,
726 viewport_GetTag,
727 viewport_SetTag,
728 viewport_GetViewportRect,
729 viewport_SetViewportRect,
730 viewport_ZoomToRect,
731 viewport_SetViewportTransform,
732 viewport_SyncDisplayTransform,
733 viewport_GetPrimaryContent,
734 viewport_AddContent,
735 viewport_RemoveContent,
736 viewport_SetViewportOptions,
737 viewport_AddConfiguration,
738 viewport_RemoveConfiguration,
739 viewport_ActivateConfiguration,
740 viewport_SetManualGesture,
741 viewport_SetChaining,
742 viewport_AddEventHandler,
743 viewport_RemoveEventHandler,
744 viewport_SetInputMode,
745 viewport_SetUpdateMode,
746 viewport_Stop,
747 viewport_Abandon,
748 viewport_AddBehavior,
749 viewport_RemoveBehavior,
750 viewport_RemoveAllBehaviors
753 static HRESULT create_viewport(IDirectManipulationViewport2 **obj)
755 struct directviewport *object;
757 object = heap_alloc(sizeof(*object));
758 if(!object)
759 return E_OUTOFMEMORY;
761 object->IDirectManipulationViewport2_iface.lpVtbl = &viewportVtbl;
762 object->ref = 1;
764 *obj = &object->IDirectManipulationViewport2_iface;
766 return S_OK;
769 static HRESULT WINAPI direct_manip_QueryInterface(IDirectManipulationManager2 *iface, REFIID riid, void **ppv)
771 if (IsEqualGUID(riid, &IID_IUnknown) ||
772 IsEqualGUID(riid, &IID_IDirectManipulationManager) ||
773 IsEqualGUID(riid, &IID_IDirectManipulationManager2)) {
774 IUnknown_AddRef(iface);
775 *ppv = iface;
776 return S_OK;
779 FIXME("(%p)->(%s,%p),not found\n", iface, debugstr_guid(riid), ppv);
780 return E_NOINTERFACE;
783 static ULONG WINAPI direct_manip_AddRef(IDirectManipulationManager2 *iface)
785 struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
786 ULONG ref = InterlockedIncrement(&This->ref);
788 TRACE("(%p) ref=%u\n", This, ref);
790 return ref;
793 static ULONG WINAPI direct_manip_Release(IDirectManipulationManager2 *iface)
795 struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
796 ULONG ref = InterlockedDecrement(&This->ref);
798 TRACE("(%p) ref=%u\n", This, ref);
800 if (!ref)
802 if(This->updatemanager)
803 IDirectManipulationUpdateManager_Release(This->updatemanager);
804 heap_free(This);
806 return ref;
809 static HRESULT WINAPI direct_manip_Activate(IDirectManipulationManager2 *iface, HWND window)
811 struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
812 FIXME("%p, %p\n", This, window);
813 return E_NOTIMPL;
816 static HRESULT WINAPI direct_manip_Deactivate(IDirectManipulationManager2 *iface, HWND window)
818 struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
819 FIXME("%p, %p\n", This, window);
820 return E_NOTIMPL;
823 static HRESULT WINAPI direct_manip_RegisterHitTestTarget(IDirectManipulationManager2 *iface, HWND window,
824 HWND hittest, DIRECTMANIPULATION_HITTEST_TYPE type)
826 struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
827 FIXME("%p, %p, %p, %d\n", This, window, hittest, type);
828 return E_NOTIMPL;
831 static HRESULT WINAPI direct_manip_ProcessInput(IDirectManipulationManager2 *iface, const MSG *msg, BOOL *handled)
833 struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
834 FIXME("%p, %p, %p\n", This, msg, handled);
835 return E_NOTIMPL;
838 static HRESULT WINAPI direct_manip_GetUpdateManager(IDirectManipulationManager2 *iface, REFIID riid, void **obj)
840 struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
841 HRESULT hr = E_FAIL;
843 TRACE("%p, %s, %p\n", This, debugstr_guid(riid), obj);
845 *obj = NULL;
846 if(IsEqualGUID(riid, &IID_IDirectManipulationUpdateManager))
848 if(!This->updatemanager)
850 hr = create_update_manager(&This->updatemanager);
852 else
854 hr = S_OK;
857 if(hr == S_OK)
859 IDirectManipulationUpdateManager_AddRef(This->updatemanager);
860 *obj = This->updatemanager;
863 else
864 FIXME("Interface %s currently not supported.\n", debugstr_guid(riid));
866 return hr;
869 static HRESULT WINAPI direct_manip_CreateViewport(IDirectManipulationManager2 *iface, IDirectManipulationFrameInfoProvider *frame,
870 HWND window, REFIID riid, void **obj)
872 HRESULT hr = E_NOTIMPL;
873 struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
874 TRACE("%p, %p, %p, %s, %p\n", This, frame, window, debugstr_guid(riid), obj);
876 if(IsEqualGUID(riid, &IID_IDirectManipulationViewport) ||
877 IsEqualGUID(riid, &IID_IDirectManipulationViewport2) )
879 hr = create_viewport( (IDirectManipulationViewport2**)obj);
881 else
882 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
883 return hr;
886 static HRESULT WINAPI direct_manip_CreateContent(IDirectManipulationManager2 *iface, IDirectManipulationFrameInfoProvider *frame,
887 REFCLSID clsid, REFIID riid, void **obj)
889 struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
890 FIXME("%p, %p, %s, %p\n", This, frame, debugstr_guid(riid), obj);
891 return E_NOTIMPL;
894 static HRESULT WINAPI direct_manip_CreateBehavior(IDirectManipulationManager2 *iface, REFCLSID clsid, REFIID riid, void **obj)
896 struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
897 FIXME("%p, %s, %s, %p\n", This, debugstr_guid(clsid), debugstr_guid(riid), obj);
898 return E_NOTIMPL;
901 static const struct IDirectManipulationManager2Vtbl directmanipVtbl =
903 direct_manip_QueryInterface,
904 direct_manip_AddRef,
905 direct_manip_Release,
906 direct_manip_Activate,
907 direct_manip_Deactivate,
908 direct_manip_RegisterHitTestTarget,
909 direct_manip_ProcessInput,
910 direct_manip_GetUpdateManager,
911 direct_manip_CreateViewport,
912 direct_manip_CreateContent,
913 direct_manip_CreateBehavior
916 static HRESULT WINAPI DirectManipulation_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
918 struct directmanipulation *object;
919 HRESULT ret;
921 TRACE("(%p, %s, %p)\n", outer, debugstr_guid(riid), ppv);
923 *ppv = NULL;
925 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
926 if (!object)
927 return E_OUTOFMEMORY;
929 object->IDirectManipulationManager2_iface.lpVtbl = &directmanipVtbl;
930 object->ref = 1;
932 ret = direct_manip_QueryInterface(&object->IDirectManipulationManager2_iface, riid, ppv);
933 direct_manip_Release(&object->IDirectManipulationManager2_iface);
935 return ret;
938 struct directcompositor
940 IDirectManipulationCompositor2 IDirectManipulationCompositor2_iface;
941 IDirectManipulationFrameInfoProvider IDirectManipulationFrameInfoProvider_iface;
942 IDirectManipulationUpdateManager *manager;
943 LONG ref;
946 static inline struct directcompositor *impl_from_IDirectManipulationCompositor2(IDirectManipulationCompositor2 *iface)
948 return CONTAINING_RECORD(iface, struct directcompositor, IDirectManipulationCompositor2_iface);
951 static inline struct directcompositor *impl_from_IDirectManipulationFrameInfoProvider(IDirectManipulationFrameInfoProvider *iface)
953 return CONTAINING_RECORD(iface, struct directcompositor, IDirectManipulationFrameInfoProvider_iface);
956 static HRESULT WINAPI compositor_QueryInterface(IDirectManipulationCompositor2 *iface, REFIID riid, void **ppv)
958 struct directcompositor *This = impl_from_IDirectManipulationCompositor2(iface);
960 if (IsEqualGUID(riid, &IID_IUnknown) ||
961 IsEqualGUID(riid, &IID_IDirectManipulationCompositor) ||
962 IsEqualGUID(riid, &IID_IDirectManipulationCompositor2))
964 IUnknown_AddRef(iface);
965 *ppv = iface;
966 return S_OK;
968 else if(IsEqualGUID(riid, &IID_IDirectManipulationFrameInfoProvider))
970 IUnknown_AddRef(iface);
971 *ppv = &This->IDirectManipulationFrameInfoProvider_iface;
972 return S_OK;
975 FIXME("(%p)->(%s,%p),not found\n", iface, debugstr_guid(riid), ppv);
976 return E_NOINTERFACE;
979 static ULONG WINAPI compositor_AddRef(IDirectManipulationCompositor2 *iface)
981 struct directcompositor *This = impl_from_IDirectManipulationCompositor2(iface);
982 ULONG ref = InterlockedIncrement(&This->ref);
984 TRACE("(%p) ref=%u\n", This, ref);
986 return ref;
989 static ULONG WINAPI compositor_Release(IDirectManipulationCompositor2 *iface)
991 struct directcompositor *This = impl_from_IDirectManipulationCompositor2(iface);
992 ULONG ref = InterlockedDecrement(&This->ref);
994 TRACE("(%p) ref=%u\n", This, ref);
996 if (!ref)
998 if(This->manager)
999 IDirectManipulationUpdateManager_Release(This->manager);
1000 heap_free(This);
1002 return ref;
1005 static HRESULT WINAPI compositor_AddContent(IDirectManipulationCompositor2 *iface, IDirectManipulationContent *content,
1006 IUnknown *device, IUnknown *parent, IUnknown *child)
1008 struct directcompositor *This = impl_from_IDirectManipulationCompositor2(iface);
1009 FIXME("%p, %p, %p, %p, %p\n", This, content, device, parent, child);
1010 return E_NOTIMPL;
1013 static HRESULT WINAPI compositor_RemoveContent(IDirectManipulationCompositor2 *iface, IDirectManipulationContent *content)
1015 struct directcompositor *This = impl_from_IDirectManipulationCompositor2(iface);
1016 FIXME("%p, %p\n", This, content);
1017 return E_NOTIMPL;
1020 static HRESULT WINAPI compositor_SetUpdateManager(IDirectManipulationCompositor2 *iface, IDirectManipulationUpdateManager *manager)
1022 struct directcompositor *This = impl_from_IDirectManipulationCompositor2(iface);
1023 TRACE("%p, %p\n", This, manager);
1025 if(!manager)
1026 return E_INVALIDARG;
1028 This->manager = manager;
1029 IDirectManipulationUpdateManager_AddRef(This->manager);
1030 return S_OK;
1033 static HRESULT WINAPI compositor_Flush(IDirectManipulationCompositor2 *iface)
1035 struct directcompositor *This = impl_from_IDirectManipulationCompositor2(iface);
1036 FIXME("%p\n", This);
1037 return E_NOTIMPL;
1040 static HRESULT WINAPI compositor_AddContentWithCrossProcessChaining(IDirectManipulationCompositor2 *iface,
1041 IDirectManipulationPrimaryContent *content, IUnknown *device, IUnknown *parentvisual, IUnknown *childvisual)
1043 struct directcompositor *This = impl_from_IDirectManipulationCompositor2(iface);
1044 FIXME("%p %p %p %p %p\n", This, content, device, parentvisual, childvisual);
1045 return E_NOTIMPL;
1048 static const struct IDirectManipulationCompositor2Vtbl compositorVtbl =
1050 compositor_QueryInterface,
1051 compositor_AddRef,
1052 compositor_Release,
1053 compositor_AddContent,
1054 compositor_RemoveContent,
1055 compositor_SetUpdateManager,
1056 compositor_Flush,
1057 compositor_AddContentWithCrossProcessChaining
1060 static HRESULT WINAPI provider_QueryInterface(IDirectManipulationFrameInfoProvider *iface, REFIID riid, void **ppv)
1062 struct directcompositor *This = impl_from_IDirectManipulationFrameInfoProvider(iface);
1063 return IDirectManipulationCompositor2_QueryInterface(&This->IDirectManipulationCompositor2_iface, riid, ppv);
1066 static ULONG WINAPI provider_AddRef(IDirectManipulationFrameInfoProvider *iface)
1068 struct directcompositor *This = impl_from_IDirectManipulationFrameInfoProvider(iface);
1069 return IDirectManipulationCompositor2_AddRef(&This->IDirectManipulationCompositor2_iface);
1072 static ULONG WINAPI provider_Release(IDirectManipulationFrameInfoProvider *iface)
1074 struct directcompositor *This = impl_from_IDirectManipulationFrameInfoProvider(iface);
1075 return IDirectManipulationCompositor2_Release(&This->IDirectManipulationCompositor2_iface);
1078 static HRESULT WINAPI provider_GetNextFrameInfo(IDirectManipulationFrameInfoProvider *iface, ULONGLONG *time,
1079 ULONGLONG *process, ULONGLONG *composition)
1081 struct directcompositor *This = impl_from_IDirectManipulationFrameInfoProvider(iface);
1082 FIXME("%p, %p, %p, %p\n", This, time, process, composition);
1083 return E_NOTIMPL;
1086 static const struct IDirectManipulationFrameInfoProviderVtbl providerVtbl =
1088 provider_QueryInterface,
1089 provider_AddRef,
1090 provider_Release,
1091 provider_GetNextFrameInfo
1094 static HRESULT WINAPI DirectCompositor_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
1096 struct directcompositor *object;
1097 HRESULT ret;
1099 TRACE("(%p, %s, %p)\n", outer, debugstr_guid(riid), ppv);
1101 *ppv = NULL;
1103 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
1104 if (!object)
1105 return E_OUTOFMEMORY;
1107 object->IDirectManipulationCompositor2_iface.lpVtbl = &compositorVtbl;
1108 object->IDirectManipulationFrameInfoProvider_iface.lpVtbl = &providerVtbl;
1109 object->ref = 1;
1111 ret = compositor_QueryInterface(&object->IDirectManipulationCompositor2_iface, riid, ppv);
1112 compositor_Release(&object->IDirectManipulationCompositor2_iface);
1114 return ret;
1117 static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
1119 *ppv = NULL;
1121 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IClassFactory, riid)) {
1122 *ppv = iface;
1125 if(*ppv) {
1126 IUnknown_AddRef((IUnknown*)*ppv);
1127 return S_OK;
1130 WARN("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
1131 return E_NOINTERFACE;
1134 static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
1136 TRACE("(%p)\n", iface);
1137 return 2;
1140 static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
1142 TRACE("(%p)\n", iface);
1143 return 1;
1146 static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
1148 TRACE("(%p)->(%x)\n", iface, fLock);
1149 return S_OK;
1152 static const IClassFactoryVtbl DirectFactoryVtbl = {
1153 ClassFactory_QueryInterface,
1154 ClassFactory_AddRef,
1155 ClassFactory_Release,
1156 DirectManipulation_CreateInstance,
1157 ClassFactory_LockServer
1160 static const IClassFactoryVtbl DirectCompositorVtbl = {
1161 ClassFactory_QueryInterface,
1162 ClassFactory_AddRef,
1163 ClassFactory_Release,
1164 DirectCompositor_CreateInstance,
1165 ClassFactory_LockServer
1168 static IClassFactory direct_factory = { &DirectFactoryVtbl };
1169 static IClassFactory compositor_factory = { &DirectCompositorVtbl };
1171 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
1173 if(IsEqualGUID(&CLSID_DirectManipulationManager, rclsid) ||
1174 IsEqualGUID(&CLSID_DirectManipulationSharedManager, rclsid) ) {
1175 TRACE("(CLSID_DirectManipulationManager %s %p)\n", debugstr_guid(riid), ppv);
1176 return IClassFactory_QueryInterface(&direct_factory, riid, ppv);
1178 else if(IsEqualGUID(&CLSID_DCompManipulationCompositor, rclsid)) {
1179 TRACE("(CLSID_DCompManipulationCompositor %s %p)\n", debugstr_guid(riid), ppv);
1180 return IClassFactory_QueryInterface(&compositor_factory, riid, ppv);
1183 FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
1184 return CLASS_E_CLASSNOTAVAILABLE;